package classTest_03.service.impl;

import classTest_03.dao.NewsDao;
import classTest_03.dao.impl.NewsDaoImpl;
import classTest_03.entity.News;
import classTest_03.service.NewsService;

public class NewsServiceIml implements NewsService {

    //实例化所依赖的NewsDao对象
    //private NewsDao dao = new NewsDaoImpl();
    public void addNews(News news){
        //调用NewsDao的方法保存新闻信息
        dao.save(news);
    }
    private NewsDao dao;
    public void setDao(NewsDao dao){
        this.dao = dao;
    }

}
